import request from '@/utils/request'

// 获取所有分类
export function getAllClassify(){
  return request({
    url:'/api/classify',
    method:'get'
  })
}

export function addClassify(data){
  /**
   * data   {name:'武侠',isShow:1}
   */
  return request({
    url:'/api/addClassify',
    method:'post',
    data
  })
}
// 根据id获取某一个分类
export function getClassifyById(classifyId){
  return request({
    url:'/api/getClassifyById?classifyId=' + classifyId,
    method:'get'
  })
}

// 根据id修改分类
export function updateClassify(data){
  return request({
    url:'/api/updateClassify',
    method:'post',
    data
  })
}
// 隐藏分类
export function deleteClassifyApi(data){
  return request({
    url:'/api/deleteClassifyById',
    method:'post',
    data
  })
}
// 隐藏分类
export function hideClassifyApi(data){
  return request({
    url:'/api/updateClassify',
    method:'post',
    data
  })
}

// 显示分类
export function showClassifyApi(data){
  return request({
    url:'/api/updateClassify',
    method:'post',
    data
  })
}